package cn.db.controller;

import cn.db.entity.Order;
import cn.db.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RequestMapping("/order")
@RestController
public class OrderController {

    @Autowired
    private OrderService orderService;

    @PostMapping("/save")
    public String save(@RequestBody Order order){
        int result = orderService.insert(order);
        System.out.println("保存的结果:"+result);
        return "success";
    }

}
